import time

'''
装饰器
    -增强原生函数的功能
'''

# 从1970.1.1.0:0:0开始到现在的秒数
t = time.time()
# print(t)

def log(func):
    def wrapper(*args,**kw):
        print('函数%s在执行：'%func.__name__)
        r =  func(*args,**kw)
        print('函数%s执行完毕！'%func.__name__)
        return r
    return wrapper


@log # now = log(now)
def now():
    # print('函数%s在执行：'%now.__name__)
    print(time.strftime('%Y/%m/%d %H:%M:%S'))

now()

# print(now.__name__)

@log
def f(a,b):
    print('%d+%d=%d'%(a,b,a+b))

# f = log(f)
f(2,3)
